import { axios } from '@/utils/request'

const api = {
  cateTreeList: '/adminapi/cms/cateTreeList',
  cateList: '/adminapi/cms/cateList',
  cateAdd: '/adminapi/cms/cateAdd',
  cateEdit: '/adminapi/cms/cateEdit',
  cateDelete: '/adminapi/cms/cateDelete',
  cateDetail: '/adminapi/cms/cateDetail',
  contentList: '/adminapi/cms/contentList',
  contentAdd: '/adminapi/cms/contentAdd',
  contentEdit: '/adminapi/cms/contentEdit',
  contentDetail: '/adminapi/cms/contentDetail',
  contentDelete: '/adminapi/cms/contentDelete',
  setContentRank: '/adminapi/cms/setContentRank',
  setContentAllStatus: '/adminapi/cms/setContentAllStatus',
}

export default api

export function getContentList(parameter) {
  return axios({
    url: api.contentList,
    method: 'get',
    params: parameter
  })
}
export function getContentDetail(parameter) {
  return axios({
    url: api.contentDetail,
    method: 'get',
    params: parameter
  })
}
export function getCateTreeList(parameter) {
  return axios({
    url: api.cateTreeList,
    method: 'get',
    params: parameter
  })
}
export function getCateList(parameter) {
  return axios({
    url: api.cateList,
    method: 'get',
    params: parameter
  })
}
export function addContent(parameter) {
  return axios({
    url: api.contentAdd,
    method: 'post',
    data: parameter
  })
}
export function editContent(parameter) {
  return axios({
    url: api.contentEdit,
    method: 'post',
    data: parameter
  })
}
export function addCate(parameter) {
  return axios({
    url: api.cateAdd,
    method: 'post',
    data: parameter
  })
}
export function editCate(parameter) {
  return axios({
    url: api.cateEdit,
    method: 'post',
    data: parameter
  })
}
export function deleteCate(parameter) {
  return axios({
    url: api.cateDelete,
    method: 'post',
    data: parameter
  })
}
export function setContentRank(parameter) {
  return axios({
    url: api.setContentRank,
    method: 'post',
    data: parameter
  })
}
export function getCateDetail(parameter) {
  return axios({
    url: api.cateDetail,
    method: 'get',
    params: parameter
  })
}

export function deleteContent(parameter) {
  return axios({
    url: api.contentDelete,
    method: 'post',
    data: parameter
  })
}

export function setContentAllStatus(parameter) {
  return axios({
    url: api.setContentAllStatus,
    method: 'post',
    data: parameter
  })
}
